﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<IntroduceCompany.ProductImage>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ProductImage
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Album Sản Phẩm</span>
            <div class="switchbutton">
                <a href="<%= Url.Action("ProductCreate", "Product") %>" class="button">Thêm mới</a>
                <a href="<%= Url.Action("ProductEdit","Product", new { productID = ViewData["productID"], productLanguageID = IntroduceCompany.Util.ConstantClass.mainLanguageID }) %>"  class="button">
                Chỉnh sửa sản phẩm</a>
                <a href="<%= Url.Action("ProductListBackend", "Product") %>" class="button">Danh sách</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
            <% using (Html.BeginForm("InsertProductImage", "Product", FormMethod.Post, new { enctype = "multipart/form-data" })){%>
            <div>
                <div class="editor_left">
                    <label>Mã số sản phẩm: </label> <%= ViewData["productID"] %>
                </div>
            </div><br class="clear"/><br />
            <div>
                <div >
                    <label>Đăng ảnh:</label>
                    <input type="file" id="fileToUpload" name="fileToUpload" multiple="multiple" accept="gif|jpg|png"/>
                    <%= Html.Hidden("productID", ViewData["productID"]) %>
                    <input type="submit" name="upload" value="Upload" style="margin-left:15px;"/>
                </div>
            </div><br class="clear"/>
            <%} %>
        </div>
    </div>

    <div class="album_photolist">
        <ul class="media_photos">
        <% foreach (var item in Model) { %>
            <li>  
                <a href="<%= Url.Action("DeleteProductImage","Product",new { imageID = item.ProductImageID, productID = ViewData["productID"]}) %>" class="delphoto" 
                    onclick="javascript: if (confirm('Bạn muốn xóa hình này hay không?')) { window.location.href='#' } else { return false; };"></a>
                <a rel="slide" href="../../../Image/Product/<%= item.ProductImageName%>" title="asd">
                <img src="../../../Image/Product/thumbnail/<%= item.ProductImageName %>" alt="" />
            </a>
            </li>
        <% } %>
        </ul>
    </div>
   
</asp:Content>

